#ifndef MODULEOBJ_H
#define MODULEOBJ_H

#include "instobj.h"

namespace xvs {

class ModuleData;

/**
 * @brief The ModuleObj class   模块对象类(默认存在入口任务,入口任务不可删除/修改)
 */
class OBJLIB_EXPORT ModuleObj : public InstObj
{
    Q_OBJECT
public:
    ModuleObj();

    int Execute() override;

    XVWidget * Editor(QWidget *parent = nullptr) override;

public:
    TaskObj* NewTask();

    TaskObj* MainTask();
    TaskObj* MainForm();

private:
    ModuleData* d_ptr;
};


class OBJLIB_EXPORT AbstractProjectObj : public XVObject
{
    Q_OBJECT
public:
    AbstractProjectObj()
    {
        this->SetObjType(ObjType_Project);
        ModuleObj* mainmodule = new ModuleObj();
        mainmodule->SetName("MainModule");
    }

public:
    virtual QJsonObject Save(const QString&) = 0;
    virtual void Load(QJsonObject &,const QString&) {}

public:
//    ModuleObj* NewModule();

//    ModuleObj* MainModule();
};

class OBJLIB_EXPORT AbstractProjectMgr : public XVObject
{
    Q_OBJECT
public:
    AbstractProjectMgr()
    {
        this->SetObjType(ObjType_ProMgr);
    }

    virtual QJsonObject Save(const QString&) = 0;

    virtual void Load(QJsonObject &,const QString&) {}
};


}

#endif // MODULEOBJ_H
